{extends file="layout/layout.tpl"}

{block name=otherLibraries}
<script type="text/javascript" src="/javascripts/jquery/jquery.qtip.min.js"></script>
<script type="text/javascript" src="/uploadify/swfobject.js"></script>
<script type="text/javascript" src="/uploadify/jquery.uploadify.js"></script>
<script type="text/javascript" src="/javascripts/banner/index.js"></script>
<link type="text/css" rel="stylesheet" href="/css/banner/index.css"/>
{/block}

{block name=otherComponents}
<table cellpadding="0" cellspacing="0" border="0" width="100%" align="center">
  <tr>
    <td style="padding: 5px 5px 10px 5px;"><img src="/images/logo.png" alt="Logo" /></td>
	{include file="profile/change_password.tpl"}
  </tr>
  <tr>
    <td colspan="2" style="padding: 10px 5px 0px 5px;">
    	{include file="menu/banner.tpl"}
      	<div id="tab_main">
	        <div id="tab_content">
	        	<div style="padding: 0 0 5px 0;" id="topWrapper">
					<span id="listBannerTypeSelectWrapper" style="display: none">
		          	Loại banner:
		            <select id="listBannerTypeID" style="min-width: 100px;">
		            </select>
					</span>
					<!-- New banner button will be appended here-->
					
	         	</div>
	        	<div class="table_border" id="listBannerTableWrapper" style="display: none">
					<table id="listBannerTable" cellpadding="0" cellspacing="0" width="100%">
						<thead>
							<tr>
								<th style="width: 4em;">ID</th>
								<th>Banner</th>
								<th style="width: 10em;">URL</th>
								<th style="width: 4em;">Target</th>
								<th style="width: 4em;">Ưu tiên</th>
								<th style="width: 6em;">Trạng thái</th>
								<th style="width: 7em;">Chức năng</th>
							</tr>
						</thead>
						<tbody>
						</tbody>
					</table>
	          	</div>
				<div id="selectPrivReport" style="display: none">Bạn không có quyền liệt kê banner</div>
	        </div>
		</div>
	</td>
  </tr>
  <tr>
  	<td colspan="2" style="padding: 0 5px;" class="footer">&copy; BMSC giữ bản quyền {$smarty.now|date_format: "%Y"}</td>
  </tr>
</table>
<div id="newBannerDialog" title="Thêm banner">
  <form id="newBannerForm" method="post">
  <table width="100%">
    <tr id="newBannerErrorRow">
      <td>&nbsp;</td>
      <td id="newBannerErrorMessage" class="error"></td>
    </tr>
    <tr>
      <td align="right">Loại <span class="required">*</span></td>
      <td>
      	<select id="newBannerTypeID" name="newBannerTypeID" style="min-width: 100px;">
        </select>
      </td>
    </tr>
    <tr>
      <td align="right">Liên kết</td>
      <td>
      	<input type="text" id="newBannerURL" name="newBannerURL" style="width: 400px;" />
        <select id="newBannerTarget" name="newBannerTarget" style="min-width: 70px;">
        	<option value="">----</option>
        	<option value="_self">_self</option>
          <option value="_blank">_blank</option>
        </select>
      </td>
    </tr>
    <tr>
      <td align="right">Banner <span class="required">*</span></td>
      <td><input type="file" id="newBannerUpload" name="newBannerUpload"/><input type="hidden" id="newBannerFilename" name="newBannerFilename" /></td>
    </tr>
    <tr>
      <td align="right">Ưu tiên</td>
      <td>
      	<input type="text" id="newBannerPriority" name="newBannerPriority" style="width: 45px;" />
      </td>
    </tr>
    <tr>
      <td align="right">Kích hoạt</td>
      <td>
      	<input type="checkbox" id="newBannerIsActive" name="newBannerIsActive" value="1" checked="checked" />
      </td>
    </tr>
  </table>
  </form>
</div>
<div id="editBannerDialog" title="Sửa banner">
  <form id="editBannerForm" method="post">
  <table width="100%">
    <tr id="editBannerErrorRow">
      <td>&nbsp;</td>
      <td id="editBannerErrorMessage" class="error"></td>
    </tr>
    <tr>
      <td align="right">Loại <span class="required">*</span></td>
      <td>
      	<select id="editBannerTypeID" name="editBannerTypeID" style="min-width: 100px;">
        </select>
      </td>
    </tr>
    <tr>
      <td align="right">Liên kết</td>
      <td>
      	<input type="text" id="editBannerURL" name="editBannerURL" style="width: 400px;" />
        <select id="editBannerTarget" name="editBannerTarget" style="min-width: 70px;">
        	<option value="">----</option>
        	<option value="_self">_self</option>
          <option value="_blank">_blank</option>
        </select>
      </td>
    </tr>
    <tr>
      <td align="right">Banner <span class="required">*</span></td>
      <td><input type="file" id="editBannerUpload" name="editBannerUpload"/><input type="hidden" id="editBannerFilename" name="editBannerFilename" /></td>
    </tr>
    <tr>
      <td align="right">Ưu tiên</td>
      <td>
      	<input type="text" id="editBannerPriority" name="editBannerPriority" style="width: 45px;" />
      </td>
    </tr>
    <tr>
      <td align="right">Kích hoạt</td>
      <td>
      	<input type="checkbox" id="editBannerIsActive" name="editBannerIsActive" value="1" checked="checked" />
        <input type="hidden" id="editBannerID" name="editBannerID" />
        <input type="hidden" id="editBannerOldFilename" name="editBannerOldFilename" />
      </td>
    </tr>
  </table>
  </form>
</div>
<div id="removeBannerDialog" title="Xóa banner">
	<form id="removeBannerForm" method="post">
    <div><img src="/images/icon/delete_32.png" align="left" /> Bạn có chắc chắn xóa banner có ID: <span id="removeShowBannerID" style="font-weight: bold;"></span>?</div>
    <input type="hidden" id="removeBannerID" name="removeBannerID" />
  </form>
</div>
{/block}